package com.appcheck.recording;

import com.appcheck.recording.test.Recording;
import com.appcheck.recording.utils.Logger;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class BroadcastReceiverWrapper extends BroadcastReceiver{
	
	private Recording recording;
	
	public BroadcastReceiverWrapper(Recording recording){
		this.recording = recording;
	}
	@Override
	public void onReceive(Context context, Intent intent) {
	    Integer msg = Integer.parseInt(intent.getStringExtra("msg"));
	    
	    Logger.WARN(
	    		new StringBuilder("Got msg from outside(will be added to queue) - msg: ").append(context).toString()
	    );
	    
	    this.recording.addMsgToQueue(msg);
	}
	
}
